FileRead, buffer, UnitTest_substitutions.txt
Text1 := buffer
Gosub, BtnConvert

Gui, Add, Edit, x12 y10 w440 h180 vText1, %buffer%
Gui, Add, Edit, x462 y10 w470 h180 vText2, %Text2%
Gui, Add, Button, x12 y200 w100 h30 gBtnConvert, &Convert
Gui, Add, Button, x122 y200 w110 h30 gBtnReload, &Reload

; Generated using SmartGUI Creator 4.0
Gui, Show, x234 y447 h243 w949, Unit Test of substuitions!
#include Capture2Text_BackEnd.ahk
OnExit, SaveText
Return

GuiClose:
ExitApp

BtnReload:
    FileDelete, UnitTest_substitutions.txt
    FileAppend, %Text1%, UnitTest_substitutions.txt
    Reload

BtnConvert:
    Gui, SubMit, NoHide
    Loop, 2
        Text2 := performsubstitutions(Text1)
    GuiControl, , Text2, %Text2%
return

SaveText:
    FileDelete, UnitTest_substitutions.txt
    FileAppend, %Text1%, UnitTest_substitutions.txt
ExitApp
